package net.oschina.app.viewpagerfragment.MyFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import net.oschina.app.util.UIUtils;

/**
 * Created by foty on 2017/4/1.
 * ?
 */

public  class BaseViewPagerAdapter extends FragmentStatePagerAdapter{
    public String[] listF;
    private int layout;
    public BaseViewPagerAdapter(FragmentManager fm, int layout) {
        super(fm);
        //获得fragment的个数集合
        listF = UIUtils.getStrings(layout);
        this.layout = layout;
    }

    @Override
    public Fragment getItem(int position) {

        return FragmentFactory.createFragments(layout,position);
    }

    @Override
    public int getCount() {
        return listF.length;
    }

    /*@Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView((View) object);
    }*/
}
